import 'ai_date_entity.dart';
import 'ai_item_entity.dart';

class AiComboEntity {
  List<DayList>? dayList;
  List<DetailItems>? comboList;
  String? leftText;
  String? rightText;
  String? info;
  String? logo;
  String? name;

  AiComboEntity(
      {this.dayList, this.comboList, this.leftText, this.rightText, this.info, this.logo, this.name});

  AiComboEntity.fromJson(Map<String, dynamic> json) {
    if (json['dayList'] != null) {
      dayList = <DayList>[];
      json['dayList'].forEach((v) {
        dayList!.add(new DayList.fromJson(v));
      });
    }
    if (json['detailItems'] != null) {
      comboList = <DetailItems>[];
      json['detailItems'].forEach((v) {
        comboList!.add(new DetailItems.fromJson(v));
      });
    }
    leftText = json['leftText'];
    rightText = json['rightText'];
    info = json['info'];
    logo = json['logo'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.dayList != null) {
      data['dayList'] = this.dayList!.map((v) => v.toJson()).toList();
    }
    if (this.comboList != null) {
      data['detailItems'] = this.comboList!.map((v) => v.toJson()).toList();
    }
    data['leftText'] = this.leftText;
    data['rightText'] = this.rightText;
    data['info'] = this.info;
    data['logo'] = this.logo;
    data['name'] = this.name;
    return data;
  }
}

class DetailItems {
  int? aiId;
  String? price;
  int? priceId;
  String? finishTime;
  int? hit;
  int? isOpen;
  int? level;
  String? levelCont;
  String? levelStr;
  List<AiItemEntity>? items;
  String? profit;
  String? title;
  bool? update;

  DetailItems(
      {this.aiId,
        this.price,
        this.priceId,
        this.finishTime,
        this.hit,
        this.isOpen,
        this.level,
        this.levelCont,
        this.levelStr,
        this.title,
        this.profit,
        this.update});

  DetailItems.fromJson(Map<String, dynamic> json) {
    aiId = json['aiId'];
    price = json['price'];
    priceId = json['priceId'];
    finishTime = json['finishTime'];
    hit = json['hit'];
    isOpen = json['isOpen'];
    level = json['level'];
    levelCont = json['levelCont'];
    levelStr = json['levelStr'];
    if (json['matchList'] != null) {
      items = <AiItemEntity>[];
      json['matchList'].forEach((v) {
        items!.add(new AiItemEntity.fromJson(v));
      });
    }
    profit = json['profit'];
    title = json['title'];
    update = json['update'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['aiId'] = this.aiId;
    data['price'] = this.price;
    data['priceId'] = this.priceId;
    data['finishTime'] = this.finishTime;
    data['hit'] = this.hit;
    data['isOpen'] = this.isOpen;
    data['level'] = this.level;
    data['levelCont'] = this.levelCont;
    data['levelStr'] = this.levelStr;
    if (this.items != null) {
      data['matchList'] = this.items!.map((v) => v.toJson()).toList();
    }
    data['profit'] = this.profit;
    data['title'] = this.title;
    data['update'] = this.update;
    return data;
  }
}